package com.crm.service.system.notice.cotroller.v1;

import com.crm.model.common.dtos.PageResponseResult;
import com.crm.model.common.dtos.ResponseResult;
import com.crm.model.system.notic.dtos.NoticeDto;
import com.crm.model.system.notic.dtos.NoticePageDto;
import com.crm.service.system.notice.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/notice")
public class NoticeController {
    @Autowired
    private NoticeService noticeService;

    @GetMapping("/page")
    public PageResponseResult findPage(NoticePageDto dto){
        return noticeService.findPage(dto);
    }

    @PostMapping("/add")
    public ResponseResult<String> addNotice(@RequestBody NoticeDto noticeDto){
        return noticeService.addNotice(noticeDto);
    }
}
